function [uh, U] = poisson_1d(a, b, N, basis_type, N_gauss_int1d, function_cor, function_f, function_g, function_r, boundary_type)

[node_u, elem_u, bdary_u] = processing_node_elem_bdary_1d(a, b, N, basis_type, boundary_type);

dN = reference_basis_function_1d(basis_type);

A = assemble_matrix_A_1d(node_u, elem_u, function_cor, dN, "dx", "dx", N_gauss_int1d);

b = assemble_vector_b_1d(node_u, elem_u, function_f, dN, N_gauss_int1d);

[A, b] = processing_boundary_condition_1d(A, b, node_u, bdary_u, function_cor, function_g, function_r);

U = A\b;

uh = assemble_solution_1d(node_u, elem_u, dN, U);

end